package queue;

import java.util.PriorityQueue;

/**
 * @author: 李德才
 * @description:
 * @create: 2020-12-13 20:25
 **/
public class Test_PriorityQueue {


    /**
     * PriorityQueue 排序的队列
     */
    public static void main(String[] args) {
        PriorityQueue<String> priorityQueue = new PriorityQueue<>();
        priorityQueue.add("c");
        priorityQueue.add("e");
        priorityQueue.add("b");
        priorityQueue.add("a");
        priorityQueue.add("d");
        priorityQueue.add("z");

        while (priorityQueue.iterator().hasNext()) {
            System.err.println(priorityQueue.poll());
        }

    }


}
